package com.tihi.xml;

import java.util.List;

import android.graphics.RectF;

import com.tihi.util.StringUtils;

/**
 * view节点
 * @author duantihi
 *
 * @date 2016-2-1 下午5:19:56
 * @deprecated
 */
public class ViewNodeOld extends BaseBean{
	private String index;
	private String text;
	private String classV;
	private String packageV;
	private String contentDesc;
	private String checkable;
	private String checked;
	private String clickable;
	private String enabled;
	private String focusable;
	private String focused;
	private String scrollable;
	private String longClickable;
	private String password;
	private String selected;
	private String bounds;
	private List<ViewNodeOld> subNodes;
	
	public String getIndex() {
		return index;
	}
	public void setIndex(String index) {
		this.index = index;
	}
	public String getText() {
		return text;
	}
	public void setText(String text) {
		this.text = text;
	}
	public String getClassV() {
		return classV;
	}
	public void setClassV(String classV) {
		this.classV = classV;
	}
	public String getPackageV() {
		return packageV;
	}
	public void setPackageV(String packageV) {
		this.packageV = packageV;
	}
	public String getContentDesc() {
		return contentDesc;
	}
	public void setContentDesc(String contentDesc) {
		this.contentDesc = contentDesc;
	}
	public String getCheckable() {
		return checkable;
	}
	public void setCheckable(String checkable) {
		this.checkable = checkable;
	}
	public String getChecked() {
		return checked;
	}
	public void setChecked(String checked) {
		this.checked = checked;
	}
	public String getClickable() {
		return clickable;
	}
	public void setClickable(String clickable) {
		this.clickable = clickable;
	}
	public String getEnabled() {
		return enabled;
	}
	public void setEnabled(String enabled) {
		this.enabled = enabled;
	}
	public String getFocusable() {
		return focusable;
	}
	public void setFocusable(String focusable) {
		this.focusable = focusable;
	}
	public String getFocused() {
		return focused;
	}
	public void setFocused(String focused) {
		this.focused = focused;
	}
	public String getScrollable() {
		return scrollable;
	}
	public void setScrollable(String scrollable) {
		this.scrollable = scrollable;
	}
	public String getLongClickable() {
		return longClickable;
	}
	public void setLongClickable(String longClickable) {
		this.longClickable = longClickable;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	public String getSelected() {
		return selected;
	}
	public void setSelected(String selected) {
		this.selected = selected;
	}
	public String getBounds() {
		return bounds;
	}
	public void setBounds(String bounds) {
		this.bounds = bounds;
	}
	
	public List<ViewNodeOld> getSubNodes() {
		return subNodes;
	}
	public void setSubNodes(List<ViewNodeOld> subNodes) {
		this.subNodes = subNodes;
	}
	/**
	 * 获取bounds矩形
	 * 原始数据格式： [0,0][720,1280]
	 * @return
	 */
	public RectF getBoundRectf() {
		RectF rectF = new RectF();
		if(!StringUtils.isNotEmpty(bounds)) {
			String tmp = bounds.replace("]", "");
			tmp = tmp.replace("[", ",");
			String []values = tmp.split(",");
			if(values != null && values.length == 4) {
				rectF.left = Float.valueOf(values[0]);
				rectF.top = Float.valueOf(values[1]);
				rectF.right = Float.valueOf(values[2]);
				rectF.bottom = Float.valueOf(values[3]);
			}
		}
		return rectF;
	}

}
